package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import service.TestService;

public class Example extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	//	ApplicationContext context=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
		
	//		TestService testService=(TestService)context.getBean("testService");
			
		//	testService.update();
		
		TestService testService=(TestService)LoderServlet.getBean("testService");
		
		testService.update();
		
	}
}
